<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.hbyj.hbm.vo.Members"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="com.hbyj.util.ChangeTool"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
Members mbInfo = (Members)request.getSession().getAttribute("SysUser");
String lyCode = "";
try{
	lyCode = mbInfo.getLyCode();
}catch(Exception e){
	 response.sendRedirect("login.jsp");
	 return;
}

SimpleDateFormat date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date datetime = new Date();
String time = date.format(datetime);

int flag = ChangeTool.ChangeArea(lyCode).length();
String shengName = "";String shiName = "";String xianName = "";
String shengCode = "";String shiCode = "00";String xianCode = "00";
if(flag==2){
	shengCode = lyCode;
	shengName = ChangeTool.getFinalValue(lyCode);
}else if(flag==4){
	shengCode = lyCode.substring(0,2)+"0000";
	shengName = ChangeTool.getFinalValue(shengCode);
	shiCode = lyCode.substring(0,4)+"00";
	shiName = ChangeTool.getFinalValue(shiCode);
}else if(flag==6){
	shengCode = lyCode.substring(0,2)+"0000";
	shengName = ChangeTool.getFinalValue(shengCode);
	shiCode = lyCode.substring(0,4)+"00";
	shiName = ChangeTool.getFinalValue(shiCode);
	xianCode = lyCode;
	xianName = ChangeTool.getFinalValue(xianCode);
}
%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
  <head>
    <title>系统维护界面</title>
	
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=9" >
   
	<script src="lib/jquery-1.7.1.min.js" type="text/javascript"></script>
	<script src="lib/jquery-ui-1.8.17.custom.min.js" type="text/javascript"></script>
	<script type='text/javascript' src='lib/fullcalendar/fullcalendar.js'></script>
	<script src="lib/flexigrid/flexigrid.js" type="text/javascript"></script>
	<script src="lib/zTree/js/jquery.ztree.all-3.3.js" type="text/javascript"></script>
	<script src="lib/jquery_dlg/lhgdialog.js" type="text/javascript"></script>
	<script src="lib/data.js" type="text/javascript"></script>
	<script src="lib/easyui/jquery.easyui.min_new.js" type="text/javascript" ></script>
	
	
	<script src="js/authority/department.js" type="text/javascript"></script>
	<script src="js/authority/function.js" type="text/javascript"></script>
	<script src="js/authority/role.js" type="text/javascript"></script>
	<script src="js/authority/member.js" type="text/javascript"></script>
	<script src="js/authority/zbglwh.js" type="text/javascript"></script>
	<script src="js/yjzsfunctiondlg/zbgl.js"  type="text/javascript"></script>
	
	<link href="style/authority.css" rel="stylesheet" type="text/css" />
	<link href="lib/flexigrid/flexigrid.pack.css" rel="stylesheet" type="text/css" />
	<link href="lib/zTree/zTreeStyle/zTreeStyle.css" rel="stylesheet" type="text/css" />
	<link rel='stylesheet' type='text/css' href='lib/fullcalendar/fullcalendar.css' />
	<link rel='stylesheet' type='text/css' href='lib/fullcalendar/fullcalendar.print.css' media='print' />
	<link href="lib/jquery_dlg/skins/blue.css" rel="stylesheet" type="text/css" />
	<link href="style/zbCss/easyui_new.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript">
		  $(document).ready(function () {
		    init_member_add();
            $('ul.navTabs').each(function () {
                $(this).find('li').each(function (i) {
                    $(this).click(function () {
                        $(this).addClass('tab_current').siblings().removeClass('tab_current')
						.parents('div.content').find('div.info').hide().end().find('div.info:eq(' + i + ')').fadeIn(150);
						if(i==3)
							initFunctionQuery();
						if(i==2)
							setOption('420000','department_shi_administration');
						if(i==1)
							initRole_add();
						if(i==4){
							if(!calendar)
								initPaibanWHFunc();
						}
                    });
                });
                
                $('#department ul').each(function(){
                	$(this).find('li').each(function(i){
                		$(this).click(function(){
                			$(this).parents('#department').find('.subContent').hide().end().find(
                			'.subContent:eq('+i+')').fadeIn(150);
                			if(i==1){
                			    
                				initDepartment_Query();
                			}
                		});
                	});
                });
                
               $('#role ul').each(function(){
                	$(this).find('li').each(function(i){
                		$(this).click(function(){
                			$(this).parents('#role').find('.subContent').hide().end().find(
                			'.subContent:eq('+i+')').fadeIn(150);
                		});
                	});
                });
                
                 $('#member ul').each(function(){
                	$(this).find('li').each(function(i){
                		$(this).click(function(){
                			$(this).parents('#member').find('.subContent').hide().end().find(
                			'.subContent:eq('+i+')').fadeIn(150);
                			
                		});
                	});
                });
                
                $('#zbglwh ul').each(function(){
                	$(this).find('li').each(function(i){
                		$(this).click(function(){
                			$(this).parents('#zbglwh').find('.subContent').hide().end().find(
                			'.subContent:eq('+i+')').fadeIn(150);
                			$("#tblZBRY").datagrid('resize');//表格初始化
                		});
                		
                	});
                });
                
                //////////////值班人员维护加载select
                
               	setOption('china','sheng_zbry');
                $("#sheng_zbry").attr("disabled","disabled");
                setSltDefaultVal("sheng_zbry",<%=shengCode%>);
                changeShenItem(document.getElementById("sheng_zbry").value,'shi_zbry');
                $("#queryBtn_zbry").bind('click',function(){return queryZBRYByKeyword()});//值班人员管理维护查询按钮绑定时间
                initTblZBRY();//初始化值班人员表格
                //值班人员详情对话框
                $('#detailsDialog_zbry').dialog({
					draggable : true,
					top : 50,
					left : 100,
					title : "值班人员详情",
					collapsible : true
				});
                $("#detailsDialog_zbry").dialog("close");
            });
        });
    </script>
  </head>
  
  <body>
    <div class="result" >
		<%--<div id="titledivHp" style=" height:30px; text-align:center; font-size:20px; font-family:微软雅黑; 
			font-style:normal; color:#4EACD3;">系统维护</div>
   		 --%><div class="content" >
    		<div style=" height:15px; background:#DCDCDC;"></div>
    		<ul class="navTabs">
        		<li class="tab_current" id="tab1"><div class="tabdiv" >人员维护</div></li>
        		<li id="tab2"><div class="tabdiv">角色维护</div></li>
        		<li id="tab3"><div class="tabdiv">部门维护</div></li>
        		<li id="tab4"><div class="tabdiv">功能维护</div></li>
        		<li id="tab5"><div class="tabdiv">值班管理维护</div></li>
     		</ul>
		
		<div class="info visible" id="member" style=" display:block;margin: 0 auto; font-size:12px;height:500px">
			<div style="margin-bottom:20px">
	  			<ul class="subContentNav">
	    			<li><div>添加</div></li>
	    			<li><div>查询/修改</div></li>
	    		</ul>
	    	</div>
	    	<HR style="clear:both"/>
	    	<div class="subContent" id="member_add" >
		    	<div style="margin-bottom:30px;margin-left:50px;margin-top:50px;width:800px">
		    		<div style="margin-bottom:15px">
			    	     <span style="margin-right:20px">登陆名称 ：</span>
			    	     <input style="width:206px" type="text"  id="txtMemberAdd"/>
		    	    </div>
		    		
		    		<div style="margin-bottom:15px">
		    			<span style="margin-right:20px;"> 省市区划 ：</span>
		    			<select id="member_shi_administration" style="width:210px;height:30px;font-size:15px" 
		    				onchange="onShiAdministrationChange(this.value,'member_xian_administration','selectDepartment')">
	        				<option value="-1" selected="selected">湖北省</option>
						</select>
					</div>
				
					 <div  style="margin-bottom:15px">
						<span style="margin-right:20px"> 县级区划 ：</span>
						<select id="member_xian_administration" style="width:210px;height:30px;font-size:15px" 
						   onchange="onXianAdministrationChange(this.value,'selectDepartment')">
							<option value="-1" selected="selected">请选择县</option>
						</select>
					</div>
		    	    
		    	    <div style="margin-bottom:15px">
		    	    	<span style="margin-right:20px">所属部门 ：</span>
		    	    	 <select style="width:210px;height:30px;font-size:15px"  id="selectDepartment"></select>
		    	    </div>
		    	    
		    		<div style="margin-bottom:15px">
		    			<span style="margin-right:20px;">功能角色 ：</span>
		    			<select style="width:210px;height:30px;font-size:15px"  id="selectRole"></select> 
		    		</div>
		    		
		    		<div style="margin-bottom:15px">
		    			<span style="margin-right:20px">登陆密码 ：</span>
		    			<input type="text" style="width:206px;font-size:15px"  id="txtPsw"></input> 
		    		</div>
		    		
		            <div>
		    			<span style="margin-right:20px">人员名称 ：</span>
		    			<input type="text" style="width:206px;font-size:15px"  id="txtNickName"></input> 
		    		</div>
		    		<input type="button" value="提交" style="background:#458B74;width:60px;height:30px;
	    			text-align:center;line-height:30px;
	    			cursor:pointer;font-color:white;margin-left: 200px" onclick="btnAddMemeber()"/>
	    	
		    	</div>
		  </div>
	   		<div class="subContent" id="member_query" style="display:none">
	   			<div style="margin-top:30px;margin-left:50px"><span style="margin-right:15px">人员名称：</span>
	   				<input id="txtMemberName" style="width:150px;hegith:22px" type="text"  />
	   				<input id="btn_name_query" type="submit"  class="submitBtn" style="float:right;margin-right:100px" value="查询" onclick="queryByName()"/>
	   			</div>
	   			<HR/>
	   			<div style="margin-top:30px;margin-left:50px"><span style="margin-right:15px">部门名称：</span>
	   				<input style="width:150px;hegith:22px;margin-right:50px" type="text"  id="txtDepartmentNameForMember" />
	   				<span style="margin-right:15px">角色名称：</span>
	   				<input style="width:150px;hegith:22px" type="text"  id="txtRoleNameForMember"/>
	   				<input id="btn_roledepartment_query" type="submit"  class="submitBtn" style="float:right;margin-right:100px" value="查询" onclick="queryByRoleDepartment()"/>
	   			</div>
	   			<HR/>
	   			<div class="flexGridCss"><table id="memberTable" style="display: block"></table></div>
	   			<div id="divForChangeDepartment"  style="height:30px;margin-left:20px;margin-top:10px;display:none" >
	   					<span style="margin-right:10px;">人员：</span>
	   					<input disabled="disabled" id="displayMemberName" style="width:50px"></input>
	   					<span style="margin-right:20px;margin-left:30px"> 省市区划 :</span>
		    			<select  id="query_shi_administration" style="width:150px;height:30px;font-size:15px" 
		    				onchange="onShiAdministrationChange(this.value,'query_xian_administration','query_selectDepartment')">
	        				<option value="-1" selected="selected">湖北省</option>
						</select>
						<span style="margin-right:20px;margin-left:30px"> 县级区划 </span>
						<select id="query_xian_administration" style="width:150px;height:30px;font-size:15px" 
						   onchange="onXianAdministrationChange(this.value,'query_selectDepartment')">
							<option value="-1" selected="selected">请选择县</option>
						</select>
						<span style="margin-right:20px;margin-left:30px">所属部门 </span>
		    	    	 <select style="width:150px;height:30px;font-size:15px"  id="query_selectDepartment"></select>
	   			</div>
	   		</div>
	   
	    </div>
	    
	    
	    <div class="info" id="role" style=" margin: 0 auto; font-size:12px;height:500px">
	    	<div style="margin-bottom:20px">
	  			<ul class="subContentNav">
	    			<li><div>添加</div></li>
	    			<li><div>查询/修改</div></li>
	    		</ul>
	    	</div>
	    	<HR style="clear:both"/>
	    	<div id="role_add" class="subContent">
		    	<div style="border:1px solid #C9C9C9;width:250px;height:400px;overflow-y:scroll;float:left">
		    			<ul id="treeForRole_Add" class="ztree" style="font-family:微软雅黑"></ul>
		    	 </div>
		    	 <div style="width:690px;height:468px;border:1px solid #C9C9C9;float:left">
				    	 <div style="margin-top:50px;margin-left:50px;width:360px">
				    	 		<span style="margin-right:20px;">角色名称 ：</span>
				    			<input id="txtRoleName" type="text" />
				    			<span style="display:block;color:red;margin-top:30px;margin-bottom:40px">请在左侧勾选该角色所具备的权限功能</span>
				    			<input type="button" class="submitBtn" value="提交" onclick="role_add_update('role_add.shtml',null,'treeForRole_Add')"/>
				    	 </div>
		    	 </div>
	    	 </div>
	    	<div id="role_query" class = "subContent" style="display:none">
	    		<div style="border:1px solid #C9C9C9;width:250px;height:468px;overflow-y:scroll;float:left">
		    			<ul id="treeForRole_Query" class="ztree" style="font-family:微软雅黑"></ul>
		    	 </div>
		    	  <div style="width:690px;height:468px;border:1px solid #C9C9C9;float:left">
		    	  		<div style=margin-top:30px;margin-left:30px;margin-right:20px;">
		    	  			 <span style="">角色名：</span>
		    	  			 <input id="txtRoleName_query" type="text" style=""/>
		    	  			 <input type="button" style="margin-left:50px;float:none" class="submitBtn" value="查询" onclick="role_query()"/>
		    	  		</div>
		    	 		 <div class="flexGridCss"><table id="roleTable" style="display: block"></table></div>
		    	 </div>
	    	</div>
	    </div>
	 
	  <div class="info" id="department" style="margin: 0 auto; font-size:12px;height:500px">
	  		<div style="margin-bottom:20px">
	  			<ul class="subContentNav">
	    			<li><div>添加</div></li>
	    			<li><div>查询/修改</div></li>
	    		</ul>
	    	</div>
	    	<HR style="clear:both"/>
	    	<div id="department_add"  class="subContent" style="width:310px;margin-left:50px;margin-top:50px;">
	    		<div>
	    			<span style="margin-right:20px;">部门名称 ：</span>
	    			<input id="txtDepartmentName" type="text" />
	    		</div>
	    		<div style="margin-top:50px">
	    			<span style="margin-right:20px;"> 省市区划 ：</span>
	    			<select id="department_shi_administration" style="width:210px;height:30px;font-size:15px" 
	    				onchange="changeShiItem(this.value,'department_xian_administration')">
        				<option value="-1" selected="selected">湖北省</option>
					</select>
				</div>
				
			 <div  style="margin-top:50px">
				<span style="margin-right:20px"> 县级区划 ：</span>
				<select id="department_xian_administration" style="width:210px;height:30px;font-size:15px">
					<option value="-1" selected="selected">请选择县</option>
				</select>
			</div>
		   		
		   		<div style="margin-top:50px">
		   			<div id="department_add_submit"  class="submitBtn" onclick="department_add()"><span>提交</span></div>
		   		</div>
		   	</div>
		   	<div id="department_query" class="subContent" style="margin-left:10px;margin-top:20px;" >
				<div class="flexGridCss"><table id="departmentTable" style="display: block;font-family:微软雅黑"></table></div>
				<div id="department_citytown_change"  style="height:30px;margin-left:20px;margin-top:10px;display:none" >
					<span style="margin-right:10px;">当前编号：</span>
   					<input disabled="disabled" id="selectedDepartmentId" style="width:50px"></input>
   					<span style="margin-right:20px;margin-left:30px"> 省市区划 :</span>
	    			<select  id="department_query_shi_admini" style="width:120px;height:30px;font-size:15px" 
	    				onchange="changeShiItem(this.value,'department_query_xian_admini')">
        				<option value="-1" selected="selected">湖北省</option>
					</select>
					<span style="margin-right:20px;margin-left:30px"> 县级区划 : </span>
					<select id="department_query_xian_admini" style="width:120px;height:30px;font-size:15px">
						<option value="-1" selected="selected">请选择县</option>
					</select>
					<span style="margin-right:20px;margin-left:30px">部门 : </span>
	    	    	 <input type="text" style="width:150px;height:25px;font-size:15px"  id="department_query_name" />
   			</div>
		   	</div>
		   </div>
		
		
		<div class="info" id="function" style=" border:1px solid #DCDCDC;margin: 0 auto; font-size:12px;height:500px">
		   	<div style="margin-bottom:20px">
	  			<ul class="subContentNav">
	  			    <li><div>查询/修改</div></li>
	    			<li><div>添加</div></li>
	    		</ul>
	    		<HR style="clear:both"/>
	    		<div id="function_query" class="subContent">
	    			<div style="border:1px solid #C9C9C9;width:250px;height:400px;overflow-y:scroll;float:left">
	    				<ul id="treeDemo" class="ztree"></ul>
	    			</div>
	    				 <div style="width:690px;height:468px;border:1px solid #C9C9C9;float:left">
				    	 <div style="margin-top:50px;margin-left:50px;width:600px">
				    	 		<div style="" id="functionUpdateDiv">
					    	 		<span style="">修改功能名称 ：</span>
					    			<input id="txtFunctionName"  type="text" style="width:160px" />
					    			<input type="button" value="修改" style="float:right;width:80px" onclick="onUpdateFunctionName()"/>
					    			<input type="button" value="删除" style="float:right;width:80px" onclick="onDeleteFunctionName()"/>"
				    			</div>
				    			<div id="functionAddedDiv" style="margin-top:40px">
					    			<span style="">添加功能名称 ：</span>
					    			<input id="txtAddedName" type="text" style="width:160px"/>
					    			<input type="button" value="添加" style="float:right;width:80px" onclick="onAddFunctionName()"/>
				    			</div>
				    	 </div>
	    		</div>
	    	</div>
		</div>

		<div class="info" id="zbglwh" style="margin: 0 auto; font-size:12px;height:800px">
			<div style="margin-bottom:20px">
	  			<ul class="subContentNav">
	    			<li><div>排班表维护</div></li>
	    			<li><div>值班记录维护</div></li>
	    			<li><div id="zbrymanager">值班人员维护</div></li>
	    		</ul>
	    	</div>
	    	<HR style="clear:both"/>
	    	<div id="wh_paiban" class="subContent" style="width: 900px;">
	    		<div onclick="handleDateForToDB()" style="position:absolute;right:200px;top:150px;width:40px;height:26px;border:1px solid black;line-height:26px;background-color:#97D7F7;text-align:center;cursor:pointer;">确定</div>
	    	</div>
	    	<div id="wh_zhiban" class="subContent" style="display:none"></div>
	    	<div id="wh_zbry" class="subContent" style="width: 900px;height: 800px;display:none">
					省：<select id="sheng_zbry" onchange="changeShenItem(this.value,'shi_zbry')"><option  selected="selected" value="" >请选择省</option></select>
					市：<select id="shi_zbry" onchange="changeShiItem(this.value,'xian_zbry')"><option  selected="selected" value="">请选择市</option></select>
					县：<select id="xian_zbry" ><option  selected="selected" value="">请选择县</option></select>
					姓名：<input id="qName_zbry" type="text">
					<input type="button" id="addBtn_zbry" value="新增" class="submitBtn"
										onclick="" />
					<input type="button" id="queryBtn_zbry" value="搜索" class="submitBtn"
										onclick="" />
										
					<input type="hidden" id="region" />
					<table id="tblZBRY" width="820px" height="550px"></table>
				</div>
		</div>

	</div>
</div>
<!-- 值班人员详情对话框 -->
<div  id="detailsDialog_zbry" style="padding:5px;width:500px;height:300px;" >
	<input type="hidden" id="yjcz09000"/>
	<input type="hidden" id="yjcz09010"/>
	<table>
	
	<tr><td>值班单位</td><td><input type="text" id="yjcz09020"/></td><td>值班人员</td><td><input type="text" id="yjcz09030"/></td></tr>
	<tr><td>移动电话</td><td><input type="text" id="yjcz09035"/></td><td>性别</td><td><input type="text" id="yjcz09040"/></td></tr>
	<tr><td>办公电话</td><td><input type="text" id="yjcz09050"/></td><td>办公传真</td><td><input type="text" id="yjcz09060"/></td></tr>
	<tr><td>值班人员职务</td><td><input type="text" id="yjcz09110"/></td><td>邮编</td><td><input type="text" id="yjcz09080"/></td></tr>
	<tr><td>通讯地址</td><td><input type="text" id="yjcz09090"/></td><td>电子邮箱</td><td><input type="text" id="yjcz09100"/></td></tr>
	<tr><td >备注</td><td colspan="3"><input type="text" id="yjcz09120"/></td></tr>
	<tr id="btnTr">
	<td colspan="2" align="right"><input id="submitBtn"  type="button" value="保存" class="btn_2z"
					onclick="updateZBRY()" /></td>
					<td colspan="2"><input type="button" id="resetBtn" value="重置" class="btn_2z"
					onclick="resetEvent()" /></td></tr>
	</table>
	</div>
  </body>
</html>